﻿ 
 
 
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		
		<title>jb-aptech毕业设计项目</TITLE>
<meta name="renderer" content="ie-comp">
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link href="../../css/style.css" rel="stylesheet" type="text/css">
		<script src="../../script/common.js"></script>
		<script src="../../script/validate.js"></script>
        <link rel="stylesheet" href="/css/bootstrap.min.css" type="text/css"></link>
        <script type="text/javascript" src="/js/jquery.min.js"></script>
        <script type="text/javascript" src="/js/bootstrap.min.js"></script>
        <script src="../../../js/vue.js"></script>
		<script type="text/javascript">
			
			function mySave(){
				document.sysRightForm.submit();
			}
		</script>
	</head>
	<body>
		<div class="page_title">
			权限管理 > 权限管理 > 编辑权限
		</div>
        <div id="edit">
		<form name="sysRightForm" method="post" action="/CRM/sysRight.do">
			<input type="hidden" name="method" value="editSysRight">
			<div class="button_bar">
				<button class="common_button" onclick="help('');">
					帮助
				</button>
				<button class="common_button" @click="back()" type="button">
					返回
				</button>
				<button class="common_button" @click="mySave()" type="button">
					保存
				</button>
			</div>
			<table class="query_form_table">
				<tr>
					<th>
						编号
					</th>
					<td>2</td>
					<th>
						权限类型
					</th>
					<td>
						<select v-model="sysRight.right_icon">
                            <option :value="Folder">父节点</option>
                            <option :value="Document">根结点</option>
						</select>
					</td>
					<th>
						父节点
					</th>
					<td><select v-model="sysRight.right_parent_code"><option value="">--请选择父节点--</option>
<option value="L01" v-for="m in mights" :value="m.right_parent_code">{{m.right_text}}</option>
</select>
					</td>
				</tr>
				<tr>
					<th>
						权限文本
					</th>
					<td>
						<input type="text" v-model="sysRight.right_text">
					</td>
					<th>
						权限URL
					</th>
					<td>
						<input type="text" v-model="sysRight.right_url">
					</td>
					<th>权限描述</th>
					<td>
						<textarea v-model="sysRight.right_tip"></textarea>
					</td>
				</tr>
			</table>
		</form>
        </div>
        <script>
            var rights=new Vue({
                el:"#edit",
                data:{
                    sysRight:{
                        right_text:'',
                        right_url:'',
                        right_tip:'',
                        right_icon:''
                    },
                    mights:[]
                },
                methods:{
                    mySave(){
                        $.getJSON("/SysMight/saveMight",this.sysRight,function(json){
                            if(json.code==200){
                                alert("保存成功！");
                            }else{
                                alert("保存失败！");
                            }
                        });
                    },
                    back(){
                        location="/html/~right/right/list.html";
                    }
                },
                created(){
                    this.sysRight=JSON.parse(sessionStorage.getItem("might"));
                    $.getJSON("/SysMight/query",{},function (json) {
                        rights.mights = json.data.list;
                    });
                }
            });
        </script>
	</body>
</html>
